<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="com.tjtt.tdm.base.PubMethod" %>
<%@ page language="java" import="com.tjtt.common.utils.DateUtilsAll"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
  <head>
  <base target="_self"/>
  
  <title>选择审核人员</title>
  	<%@ include file="../jslib/jquerylib.jsp" %> 
	<link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=path %>/jslib/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js"  defer="defer"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/demo.css" />
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>

   <style type="text/css">
		body{
			background:#ffffff; background-image:url(images/);
		}
	</style>
    <script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var stateValue="";
    var jiancerenids = "";
    $().ready(function(){
    	if("0"==${view}){
	        	for (i = 0;i < document.all.length; i++)
				{
					if (document.all[i].type == 'button' || document.all[i].type == 'submit' || document.all[i].type == 'reset')
					{
						document.all[i].style.display = "none";
					}
				}	
				document.getElementById("closeBtn").style.display="block";
	        }
		//样品-检测项目列表
		     if('${stateid}'=='proc8' || '${stateid}'=='proc9' || '${stateid}'=='proc10' || '${stateid}'=='proc11' || '${stateid}'=='proc12'){
				$("#gridTable").jqGrid({//填写原始记录---审核原始记录
					url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','检测类别','检测项目','检测参数','原始记录名称','记录是否审核','检测标准','样品编号','检测人员','报告识别号','报告是否审核','报告要求','样品附件','检测项目附件','样品附件ID','项目附件ID','MAINID','是否有附件','操作'],
					colModel:[
						{name:'ID',index:'ID', width:70,key:true,hidden:true}, 
						{name:'T_JIACELEIBIE',index:'T_JIACELEIBIE', width:90}, 
						{name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
						{name:'T_JIANCECANSHU',index:'T_JIANCECANSHU', width:100,hidden:false}, 
						{name:'T_YSJLFILEPATH',index:'T_YSJLFILEPATH', width:130}, 
						{name:'T_SFDIANZIQIANM',index:'T_SFDIANZIQIANM', width:65,hidden:true}, 
						{name:'T_JIANCEBIAOZHUN',index:'T_JIANCEBIAOZHUN', width:100}, 
						{name:'T_SAMPLENO',index:'T_SAMPLENO', width:100}, 
						{name:'T_JIANCEYUANNAME',index:'T_JIANCEYUANNAME', width:80}, 
						{name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80,hidden:true}, 
						{name:'T_REPORTSFQIANMING',index:'T_REPORTSFQIANMING', width:65,hidden:true}, 
						{name:'T_BAOGAOTYPE',index:'T_BAOGAOTYPE', width:80}, 
				     	{name:'SAMPLE_FILE_NAME',index:'SAMPLE_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.ST_ANNEX+")'>"+rowObject.SAMPLE_FILE_NAME+"</a>" }},     {name:'ITEM_FILE_NAME',index:'ITEM_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.IT_ANNEX+")'>"+rowObject.ITEM_FILE_NAME+"</a>"}},		{name:'ST_ANNEX',index:'ST_ANNEX', width:140,hidden:true}, 
						{name:'IT_ANNEX',index:'IT_ANNEX', width:140,hidden:true}, 
						{name:'MAINID',index:'MAINID', width:80,hidden:true}, 
						{name:'ISHAVEFILE',index:'ISHAVEFILE',hidden:false, width:60}, 
						{name:'UPLOADFILE',index:'UPLOADFILE',hidden:false, width:80} 
					], 
					shrinkToFit:false,
					sortname:'ID',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager",
					caption: "样品/检测项目列表",
					gridComplete:function(){ //在此事件中循环为每一行添加修改和删除链接 
						var ids=jQuery("#gridTable").jqGrid('getDataIDs'); 
						for(var i=0; i<ids.length; i++){ 
							var id=ids[i]; 
							if('${stateid}'=='proc8'){
								modify ="<a href='#' style='color:#f60' onclick='ysjlFile("+ id +")'>上传附件</a>"; //这里的onclick就是调用了上面的javascript函数 Modify(id) 
							}else{
								modify ="<a href='#' style='color:#f60' onclick='ysjlFile("+ id +")'>查看附件</a>";
							}
							jQuery("#gridTable").jqGrid('setRowData', ids[i], { UPLOADFILE: modify }); 
						} 
					},
					ondblClickRow:function(id){ rowselectYSJL(id); }
						
				});
				}else if('${stateid}'=='proc13'){//编辑报告
					$("#gridTable").jqGrid({
					url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','检测类别','检测项目','检测参数','原始记录名称','记录是否审核','检测标准','样品编号','检测人员','报告识别号','报告是否审核','报告要求','样品附件','检测项目附件','样品附件ID','项目附件ID','MAINID','是否有附件','操作'],
					colModel:[
						{name:'ID',index:'ID', width:70,key:true,hidden:true}, 
						{name:'T_JIACELEIBIE',index:'T_JIACELEIBIE', width:90}, 
						{name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
						{name:'T_JIANCECANSHU',index:'T_JIANCECANSHU', width:100,hidden:false}, 
						{name:'T_YSJLFILEPATH',index:'T_YSJLFILEPATH', width:130}, 
						{name:'T_SFDIANZIQIANM',index:'T_SFDIANZIQIANM', width:65,hidden:true}, 
						{name:'T_JIANCEBIAOZHUN',index:'T_JIANCEBIAOZHUN', width:100}, 
						{name:'T_SAMPLENO',index:'T_SAMPLENO', width:100}, 
						{name:'T_JIANCEYUANNAME',index:'T_JIANCEYUANNAME', width:80}, 
						{name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80,hidden:true}, 
						{name:'T_REPORTSFQIANMING',index:'T_REPORTSFQIANMING', width:65,hidden:true}, 
						{name:'T_BAOGAOTYPE',index:'T_BAOGAOTYPE', width:80}, 
				     	{name:'SAMPLE_FILE_NAME',index:'SAMPLE_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.ST_ANNEX+")'>"+rowObject.SAMPLE_FILE_NAME+"</a>" }},     {name:'ITEM_FILE_NAME',index:'ITEM_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.IT_ANNEX+")'>"+rowObject.ITEM_FILE_NAME+"</a>"}},		{name:'ST_ANNEX',index:'ST_ANNEX', width:140,hidden:true}, 
						{name:'IT_ANNEX',index:'IT_ANNEX', width:140,hidden:true}, 
						{name:'MAINID',index:'MAINID', width:80,hidden:true}, 
						{name:'ISHAVEFILE',index:'ISHAVEFILE',hidden:false, width:60}, 
						{name:'UPLOADFILE',index:'UPLOADFILE',hidden:false, width:80} 
					], 
					shrinkToFit:false,
					sortname:'ID',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager",
					caption: "样品/检测项目列表",
					gridComplete:function(){ //在此事件中循环为每一行添加修改和删除链接 
						var ids=jQuery("#gridTable").jqGrid('getDataIDs'); 
						for(var i=0; i<ids.length; i++){ 
							var id=ids[i]; 
							if('${stateid}'=='proc8'){
								modify ="<a href='#' style='color:#f60' onclick='ysjlFile("+ id +")'>上传附件</a>"; //这里的onclick就是调用了上面的javascript函数 Modify(id) 
							}else{
								modify ="<a href='#' style='color:#f60' onclick='ysjlFile("+ id +")'>查看附件</a>";
							}
							jQuery("#gridTable").jqGrid('setRowData', ids[i], { UPLOADFILE: modify }); 
						} 
					},
					ondblClickRow:function(id){ rowselect(id); }
						
				});
				}else if('${stateid}'=='proc14'){//报告审核
					$("#gridTable").jqGrid({
						url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
						datatype: "json",
						width : 780,
			            height : 250,
						colNames:['主键','报告名称','报告识别号','报告是否审核','原始记录名称','记录是否审核','检测项目','样品编号','是否有附件','查看附件','原始记录路径','报告路径'],
					  	colModel:[
						    {name:'ID',index:'ID', width:70,key:true,hidden:true}, 
						    {name:'BGFILENAME',index:'BGFILENAME', width:110}, 
						    {name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80}, 
						    {name:'T_REPORTSFQIANMING',index:'T_REPORTSFQIANMING', width:65}, 
						    {name:'YSJLNAME',index:'YSJLNAME', width:110}, 
						    {name:'T_SFDIANZIQIANM',index:'T_SFDIANZIQIANM', width:65}, 
						    {name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
						    {name:'T_SAMPLENO',index:'T_SAMPLENO', width:100}, 
						    {name:'ISHAVEFILE',index:'ISHAVEFILE', width:60}, 
						    {name:'UPLOADFILE',index:'UPLOADFILE',width:80}, 
						    {name:'T_YSJLFILEPATH',index:'T_YSJLFILEPATH', width:130,hidden:true},
							{name:'T_BGFILEPATH',index:'T_BGFILEPATH',hidden:true, width:80} 
					  	],  
						shrinkToFit:false,
						sortname:'ID',
						sortorder:'asc',
						viewrecords:true,
						multiselect: true, // 是否显示复选框
						multiboxonly : true, 
						rownumbers: false,//显示行号
						editable:true, 
						rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
						rowList:[15,20,50,200,500],
						toolbar: [false,"top"],
						jsonReader: {
							root:"rows",		// 数据行（默认为：rows）
							page: "page",  	// 当前页
							total: "total",  // 总页数
							records: "records",  // 总记录数
							repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
						},
						prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
						pager:"#gridPager",
						ondblClickRow:function(id){ rowselect(id); },
						caption: "样品/检测项目列表"
					});
				}else if('${stateid}'=='proc15'){//报告批准
					$("#gridTable").jqGrid({
					url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','报告名称','报告识别号','报告是否批准','原始记录名称','检测项目','样品编号','是否有附件','查看附件','原始记录路径','报告路径'],
					  	colModel:[
						    {name:'ID',index:'ID', width:70,key:true,hidden:true}, 
						    {name:'BGFILENAME',index:'BGFILENAME', width:110}, 
						    {name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80}, 
						    {name:'T_REPORTSFQIANMING',index:'T_REPORTSFQIANMING', width:65}, 
						    {name:'YSJLNAME',index:'YSJLNAME', width:110}, 
						    {name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
						    {name:'T_SAMPLENO',index:'T_SAMPLENO', width:100}, 
						    {name:'ISHAVEFILE',index:'ISHAVEFILE', width:60}, 
						    {name:'UPLOADFILE',index:'UPLOADFILE',width:80}, 
						    {name:'T_YSJLFILEPATH',index:'T_YSJLFILEPATH', width:130,hidden:true},
							{name:'T_BGFILEPATH',index:'T_BGFILEPATH',hidden:true, width:80} 
					  	],  
					shrinkToFit:false,
					sortname:'ID',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager",
					ondblClickRow:function(id){ rowselect(id); },
					caption: "样品/检测项目列表"
				});
				}else if('${stateid}'=='proc16'){//报告签章
					$("#gridTable").jqGrid({
					url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','报告名称','报告识别号','报告是否签章','原始记录名称','检测项目','样品编号','报告路径'],
					colModel:[
					   {name:'ID',index:'ID', width:70,key:true,hidden:true}, 
					   {name:'BGFILENAME',index:'BGFILENAME', width:110}, 
					   {name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80}, 
					   {name:'T_REPORTSFQIANMING',index:'T_REPORTSFQIANMING', width:65}, 
					   {name:'YSJLNAME',index:'YSJLNAME', width:110}, 
					   {name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
					   {name:'T_SAMPLENO',index:'T_SAMPLENO', width:100},
					   {name:'T_BGFILEPATH',index:'T_BGFILEPATH',hidden:true, width:80} 
					], 
					shrinkToFit:false,
					sortname:'ID',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager",
					ondblClickRow:function(id){ rowselect(id); },
					caption: "样品/检测项目列表"
				});
				}else if('${stateid}'=='gcsh'){//报告发放
					$("#gridTable").jqGrid({
						url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
						datatype: "json",
						width : 780,
			            height : 250,
						colNames:['主键','报告名称','报告识别号','原始记录名称','检测项目','样品编号','报告路径'],
						colModel:[
						   {name:'ID',index:'ID', width:70,key:true,hidden:true}, 
						   {name:'BGFILENAME',index:'BGFILENAME', width:110}, 
						   {name:'T_REPORTSHIBIEH',index:'T_REPORTSHIBIEH', width:80}, 
						   {name:'YSJLNAME',index:'YSJLNAME', width:110}, 
						   {name:'T_ITEMNAME',index:'T_ITEMNAME', width:120}, 
						   {name:'T_SAMPLENO',index:'T_SAMPLENO', width:100},
						   {name:'T_BGFILEPATH',index:'T_BGFILEPATH',hidden:true, width:80} 
						], 
						shrinkToFit:false,
						sortname:'ID',
						sortorder:'asc',
						viewrecords:true,
						multiselect: true, // 是否显示复选框
						multiboxonly : true, 
						rownumbers: false,//显示行号
						editable:true, 
						rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
						rowList:[15,20,50,200,500],
						toolbar: [false,"top"],
						jsonReader: {
							root:"rows",		// 数据行（默认为：rows）
							page: "page",  	// 当前页
							total: "total",  // 总页数
							records: "records",  // 总记录数
							repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
						},
						prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
						pager:"#gridPager",
						ondblClickRow:function(id){ rowselect(id); },
						caption: "样品/检测项目列表"
					});
				}else{
					$("#gridTable").jqGrid({
					url:common_basePath+'/autoForms/item!queryItemSampleByTaskId.action?type=0&taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','检测类别','检测项目','检测标准','样品编号','检测人id','检测人','原始记录路径','报告路径','报告要求','样品附件','检测项目附件','样品附件ID','项目附件ID'],
					colModel:[{name:'ID',index:'ID',key:true,hidden:true, width:100,hidedlg:true},
					          {name:'T_JIACELEIBIE',index:'T_JIACELEIBIE', width:100},
					          {name:'T_ITEMNAME',index:'T_ITEMNAME', width:180},
					          {name:'T_JIANCEBIAOZHUN',index:'T_JIANCEBIAOZHUN', width:180},
					          {name:'T_SAMPLENO',index:'T_SAMPLENO', width:120},
					          {name:'T_JIANCEYUANID',index:'T_JIANCEYUANID', width:180,hidden:true},
					          {name:'T_JIANCEYUANNAME',index:'T_JIANCEYUANNAME', width:180},
					          {name:'T_YSJLFILEPATH',index:'T_YSJLFILEPATH', width:140,hidden:true}, 
							  {name:'T_BGFILEPATH',index:'T_BGFILEPATH', width:140,hidden:true}, 
							  {name:'T_BAOGAOTYPE',index:'T_BAOGAOTYPE', width:140}, 
					          {name:'SAMPLE_FILE_NAME',index:'SAMPLE_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.ST_ANNEX+")'>"+rowObject.SAMPLE_FILE_NAME+"</a>" }},     
					          {name:'ITEM_FILE_NAME',index:'ITEM_FILE_NAME', width:180,hidden:true,hidedlg:false,formatter: function(cellvalue, options, rowObject) {        return "<a href='javascript:downloafAnnex(0,"+rowObject.IT_ANNEX+")'>"+rowObject.ITEM_FILE_NAME+"</a>"}},		
					          {name:'ST_ANNEX',index:'ST_ANNEX', width:140,hidden:true}, 
							  {name:'IT_ANNEX',index:'IT_ANNEX', width:140,hidden:true}
					        ],
					shrinkToFit:false,
					sortname:'T_SAMPLENO',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager",
					caption: "样品/检测项目列表"
				});
				}
				//故障信息列表
				$("#gridTable1").jqGrid({
					url:common_basePath+'/weituodan!queryGuzhangByTaskId.action?taskId=${flowtaskid}&temp='+Math.round(Math.random()*10000),
					datatype: "json",
					width : 780,
		            height : 250,
					colNames:['主键','车型','子系统','零部件','故障名称','故障等级','行驶里程','故障图片','故障发生时间','故障描述','TASKID'],
					colModel:[{name:'ID',index:'ID',key:true,hidden:true, width:100,hidedlg:true},
					          {name:'CHEXING',index:'CHEXING', width:100},
					          {name:'ZIXITONG',index:'ZIXITONG', width:100},
					          {name:'LINGBUJIAN',index:'LINGBUJIAN', width:100},
					          {name:'GUZHANGPATTERN',index:'GUZHANGPATTERN', width:120},
					          {name:'GUZHANG_DENGJI',index:'GUZHANG_DENGJI', width:80},
					          {name:'LICHENG',index:'LICHENG', width:80},
					          {name:'GUZHANGPIC',index:'GUZHANGPIC', width:80},
					          {name:'GUZHANGFASHENGTIME',index:'GUZHANGFASHENGTIME', width:80},
					          {name:'GUZHANG_MIAOSHU',index:'GUZHANG_MIAOSHU', width:180},
					          {name:'TASKID',index:'TASKID', width:180,hidden:true}
					        ],
					shrinkToFit:false,
					sortname:'ID',
					sortorder:'asc',
					viewrecords:true,
					multiselect: true, // 是否显示复选框
					multiboxonly : true, 
					rownumbers: false,//显示行号
					editable:true, 
					rowNum:<%=session.getAttribute("SYS_PAGECOUNT")%>,
					rowList:[15,20,50,200,500],
					toolbar: [false,"top"],
					jsonReader: {
						root:"rows",		// 数据行（默认为：rows）
						page: "page",  	// 当前页
						total: "total",  // 总页数
						records: "records",  // 总记录数
						repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
					},
					prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
					pager:"#gridPager1",
					caption: "故障列表"
				});
		      
        //提交  
		var options1 = {
	  	    url:'<%=request.getContextPath() %>/weituodan!chuliWeituodan.action?jiancerenids='+jiancerenids,
	  	     beforeSubmit: function() {
	   				return checking();
	    			},
	  	    dataType:'json',
	  	    success: function(data) {
	  	    //alert(data);
	  	      if(data.result=='success'){
				alert("提交成功");
			//	window.close();
				api.close();
				W.shuaXin();
	  	      }
	  	    }};
    	//提交
		$('#submitBtn').click(function(){
		    if('<%=request.getAttribute("stateid").toString()%>'=='proc3'){//编制大纲节点选择人员
			    var datas = window.showModalDialog("<%=request.getContextPath() %>/view/zhengchekekaoxingshiyan_choosenextuser.jsp?jiedian=proc3",'',"dialogWidth=500px;dialogHeight=300px");
			    var json2 = eval('('+datas+')');
		    	if("close" == json2.state){
		    		return false;
		    	}else{
					$("#dagangshenheren").val(json2.dagangshenheren);
					$("#huiqianren").val(json2.daganghuiqianren);
					$("#dagangpizhunren").val(json2.dagangpizhunren);
		    	}
	    	}else if('<%=request.getAttribute("stateid").toString()%>'=='proc8'){//填写原始记录
	    			var sfcjbg ='';  //是否出具报告
				    var sfcjysjl ='';//是否出具原始记录
				    var ids = $("#gridTable").jqGrid('getDataIDs')+"";
                    var toArr = ids.split(",");
           		    for(var i = 0;i<toArr.length;i++){
                        var row = $("#gridTable").jqGrid('getRowData',toArr[i]);
                        if(row.T_BAOGAOTYPE=='出具检测报告'){
                            sfcjbg = '0';
                        }
                        if(row.T_BAOGAOTYPE=='出具原始记录'){
                            sfcjysjl = '0';
                        }
		    	    }
		    	    var datas = window.showModalDialog("<%=request.getContextPath()%>/workflow/changguijiance_choose_bguser.jsp?flag=1&sfcjysjl="+sfcjysjl+"&sfcjbg="+sfcjbg+"&taskId=${flowtaskid}&flowtaskinfoid=${taskinfoid}&temp="+Math.round(Math.random()*10000),'',"dialogWidth=400px;dialogHeight=300px");
				    if(datas==undefined){
				       if(sfcjysjl=='0'){
				           alert("请为出具原始记录的任务选择原始记录审核人!");
				       }
				       return false;
	     	        }else{
	     	           datas = eval('('+datas+')');
	     	           $("#T_YSJLSHR").val(datas.userId1);
	     	        }
		    	    if(sfcjbg==''&&sfcjysjl==''){
		    	       alert("已选数据中检测项目的报告要求为空,不能提交!");
		    	       return false;
		    	    }
	    		//判断是否全部填写原始记录
		    	    var gridids = $("#gridTable").jqGrid('getDataIDs')+"";
		    	    var ysjlflag  = checkYsjlPath(gridids,3);
		    	    if(ysjlflag=='true'){
		    	      alert("检测项目未填写原始记录,该节点不能提交!");
		    	      return false;
		    	    }
		    	//判断原始记录是否电子签名
	    	    var ysjlsfqm  = checkYsjlPath('${taskinfoid}',4);
	    	    if(ysjlsfqm=='true'){
	    	       alert("原始记录没有电子签名,该节点不能提交!");
	    	       return false;
	    	    }
	    	}else if('<%=request.getAttribute("stateid").toString()%>'=='proc13'){//编制报告
	    	    var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
				if (!ids) {
		        	alert("请先选择记录!");  
		            return false;  
		        }
		        $("#gridids").val(ids);
	    		var datas = window.showModalDialog("<%=request.getContextPath() %>/view/zhengchekekaoxingshiyan_choosenextuser.jsp?jiedian=proc13",'',"dialogWidth=500px;dialogHeight=300px");
			    var json2 = eval('('+datas+')');
		    	if("close" == json2.state){
		    		return false;
		    	}else{
					$("#baogaoshenheren").val(json2.baogaoshenheren);
					$("#baogaopizhunren").val(json2.baogaopizhunren);
		    	}
	    	}else if('<%=request.getAttribute("stateid").toString()%>'=='proc14' && $('input[name="steptype"]:checked').val()=="step19"){//报告审核节点
	    		var flag = checkSampleSFFenpei(3,'${taskinfoid}');
		        if(flag){
		           alert("报告未审核,该节点不能提交!");
		           return false;
		        }
		        //判断原始记录是否审核
		        var ysjlsfqm  = checkYsjlPath('${taskinfoid}',4);
	    	    if(ysjlsfqm=='true'){
	    	       alert("原始记录未审核,该节点不能提交!");
	    	       return false;
	    	    }
	    	    //判断原始记录是否电子签名
	    	    var ysjlsfqm  = checkYsjlPath('${taskinfoid}',4);
	    	    if(ysjlsfqm=='true'){
	    	       alert("原始记录没有电子签名,该节点不能提交!");
	    	       return false;
	    	    }
	    	    
	    	
	    	}else if('<%=request.getAttribute("stateid").toString()%>'=='proc15' && $('input[name="steptype"]:checked').val()=="step20"){//报告批准节点
	    		 var flag = checkSampleSFFenpei(3,'${taskinfoid}');
		         if(flag){
		           alert("报告没有电子签名,该节点不能提交!");
		           return false;
		        }
	    	}
	    	//退回填写退回意见和审批意见
	      var editbackoption = false;
	      if($('input[name="steptype"]:checked').val()=="step15" || $('input[name="steptype"]:checked').val()=="step26" || $('input[name="steptype"]:checked').val()=="step27"
	      || $('input[name="steptype"]:checked').val()=="step28" || $('input[name="steptype"]:checked').val()=="step29" || $('input[name="steptype"]:checked').val()=="step30"
	      || $('input[name="steptype"]:checked').val()=="step34" || $('input[name="steptype"]:checked').val()=="step35" || $('input[name="steptype"]:checked').val()=="step36"){ 
		     editbackoption = true;
		  }
		  if(editbackoption){
		        var datas = window.showModalDialog("<%=request.getContextPath() %>/workflow/viewBackOption.jsp", window, "dialogWidth:660px;status:no;dialogHeight:400px");
		    	if(typeof(datas) == 'undefined'){    
		    	   return false; 
				}else{
				      var json = eval('(' + datas + ')');
					  $("#backoption").val(json.remarks);
					  $("#spyj").val(json.remarks);
				}
		  }else{
			    //填写审批意见
			    var datas = window.showModalDialog("<%=request.getContextPath() %>/workflow/shenpiOption.jsp", window, "dialogWidth:660px;status:no;dialogHeight:400px");
		    	if(typeof(datas) == 'undefined'){  
		    	   return false;   
				}else{
				      var json = eval('(' + datas + ')');
					  $("#spyj").val(json.remarks);
				}
				
		  }
	    	if(!confirm("是否确认提交 ？")){
		   			return false;
				}
	    	$('#pageFrom').ajaxSubmit(options1);
	            return false;
    	 });
    	$('#closeBtn').click(function(){
    		api.close();
			//window.close();
		});
		
		
	});
	// 2：报告编辑节点是否电子签名 3:报告审核节点 报告是否有电子签名
	function checkSampleSFFenpei(sign,ids){
	        var flag = false;
	          $.ajax({  
	              url : '<%=request.getContextPath() %>/codeReviewActionNew!checkSampleSFFenpei.action?taskId=${flowtaskid}&flowtaskinfoid=${taskinfoid}&flag='+sign+'&ids='+ids,  
	              type : "post", 
	              async: false,//取消异步提交 
	              dataType : "json", 
	              success : function(data, textStatus) {  
	             if(data.ajaxResult=="true")
	               {
	                flag = true;
	               }
	              }  
	         });
	         return flag;
	   }
	//sign  0:判断已选数据的样品是否接收   1:判断原始记录单的路径是否相同 2：判断原始记录是否正在编辑 3:判断列表中的数据是否全部填写原始记录 4:原始记录是否电子签名
	function checkYsjlPath(ids,sign){
	  var flag ='';
	  var params = {  
             "ids": ids,
             "sign":sign
          };  
         var actionUrl = "<%=request.getContextPath() %>/codeReviewActionNew!checkYsjlPath.action";  
             $.ajax({  
                 url : actionUrl,  
                 type : "post", 
                 async: false,//取消异步提交
                 data : params,  
                 dataType : "json",  
                 cache : false,  
             error : function(textStatus, errorThrown) {  
                 alert("系统ajax交互错误: " + textStatus.value);  
             },  
             success : function(data, textStatus) {
                 if(sign==2&&data.result=='true'){
                   flag = data.values;
                 }else{  
                   flag = data.result;
                 }
             }  
         });
	   return flag;
	}
	//自动选中多行相同原始记录路径的数据
	function rowselectYSJL(id){
		var celldata = jQuery("#gridTable").jqGrid('getCell',id,'T_YSJLFILEPATH');
		if (celldata!=''&&celldata!=undefined){
			var ids = jQuery("#gridTable").jqGrid('getDataIDs');
			for(var i=0;i<ids.length;i++){
				var celldata1 = jQuery("#gridTable").jqGrid('getCell',ids[i],'T_YSJLFILEPATH');
				if (celldata==celldata1 && id!=ids[i]){
					jQuery("#gridTable").jqGrid('setSelection',ids[i]);
				}
			}
		}
	}
	//自动选中多行相同报告路径的数据
	function rowselect(id){
		var celldata = jQuery("#gridTable").jqGrid('getCell',id,'T_BGFILEPATH');
		if (celldata!=''&&celldata!=undefined){
			var ids = jQuery("#gridTable").jqGrid('getDataIDs');
			for(var i=0;i<ids.length;i++){
				var celldata1 = jQuery("#gridTable").jqGrid('getCell',ids[i],'T_BGFILEPATH');
				if (celldata==celldata1 && id!=ids[i]){
					jQuery("#gridTable").jqGrid('setSelection',ids[i]);
				}
			}
		}
	}
   	function checking(){
   		var flag = true;
		var flowname = $.trim($("#flowname").val());
		var jiancedanwei = $("#jiancedanwei").val();
		var jiancedidian = $("#jiancedidian").val();
		var shenqingdanwei = $("#shenqingdanwei").val();
		var dizhi = $("#dizhi").val();
		var jiancemudi = $("#jiancemudi").val();
		var shuangfangyuedingdate = $("#shuangfangyuedingdate").val();
		if(flowname ==null || flowname == "" ){
			alert("任务名称不能为空！");
			$("#flowname").focus();
    		return false;
		}
		if(jiancedanwei ==null || jiancedanwei == "" ){
			alert("检测单位不能为空！");
			$("#jiancedanwei").focus();
    		return false;
		}
		if(jiancedidian ==null || jiancedidian == "" ){
			alert("检测地点不能为空！");
			$("#jiancedidian").focus();
    		return false;
		}
		if(shenqingdanwei ==null || shenqingdanwei == "" ){
			alert("申请单位不能为空！");
			$("#shenqingdanwei").focus();
    		return false;
		}
		if(dizhi ==null || dizhi == "" ){
			alert("地址不能为空！");
			$("#dizhi").focus();
    		return false;
		}
		if(jiancemudi ==null || jiancemudi == "" ){
			alert("检测目的不能为空！");
			$("#jiancemudi").focus();
    		return false;
		}
		if(shuangfangyuedingdate ==null || shuangfangyuedingdate == "" ){
			alert("双方约定日期不能为空！");
			$("#shuangfangyuedingdate").focus();
    		return false;
		}
		
	}
	 
	function checkExp(inputData){ 
		var regEx = new RegExp(/^(([^\^\.<>%&',:;=?$"'#@!~\]\[{}【】￥（）！·‘’”“。，、？：；—|\/\\/`\|])*)$/);
		var result = inputData.match(regEx);
		if (result == null) {
			return false;
		}
		return true;
	}
	function checkNum(inputData){
		var sNumber;
	    sNumber=Number(inputData);
	    if (isNaN(inputData)){
	       return false;
	     }
	    return true;
	}
	function countlen1(textarea){
	       var elem = event.relatedTarget || event.srcElement || event.target ||event.currentTarget;    
	        if(event.keyCode!=8)
			{
			  if (textarea.value.length> 249){
			        alert("最多为250个字符,字符输入超出限制!");
			        textarea.value=textarea.value.substring(0,249);
			    }
			    return true;
	 	    }
	}
		
	  //选择部门
	function selectdept(id)
	{
		var datas = window.showModalDialog("<%=request.getContextPath() %>/resource/choose/choose_organizationIndex.jsp?temp="+Math.round(Math.random()*10000),'',"dialogWidth=900px;dialogHeight=550px");
		if(typeof(datas) == 'undefined'){
		}else{
			var json1 = eval('(' + datas + ')');
			 document.getElementById("dept_"+id).value = json1.ORG_NAME;
			 document.getElementById(id).value = json1.ORG_ID;
		}
	}
	
	//选择人员
	function selectperson(id)
	{
		 var users = window.showModalDialog("<%=request.getContextPath() %>/resource/choose/chooseAllUser.jsp", window, "dialogWidth:900px;status:no;dialogHeight:500px");
    	if (users != null) {
    		var userIds = [];
            var userNames = [];
            for(var i=0;i<users.length;i++){
                userIds.push(users[i]['userid']);
                userNames.push(users[i]['username']);
            }
			    $("#"+id).val(userNames.join());
		     //   $("#"+id+"_id").val(userIds.join());
		   }
	}
	function changevalue(id){
	 	
	 	var flag = "0";
	 	if(id == 1){
	 		var fileValue = document.getElementById("file1").value;
	 		var a=fileValue.lastIndexOf("\\");
	 		var filename = fileValue.substring(a+1);
			document.getElementById("gongyingshangzizhi").value=filename;
			flag = "1";
		}else if(id == 2){
		    var fileValue = document.getElementById("file2").value;
	 		var a=fileValue.lastIndexOf("\\");
	 		var filename = fileValue.substring(a+1);
			document.getElementById("gongyingshangpingjia").value=filename;
			flag = "2";
		}
		document.getElementById("flag").value=flag;
	}
	//选择外键数据信息
	//参数信息：表明，关联列，显示列
	function selectData(id,tablename,colname,disname,cnname,fieldslist){
	    var fileColname ='hideFileName';
	    if(tablename=='DIC_STANDARD'){
	      fileColname = "YCLJS_GYYW";
	    }
		var datas = window.showModalDialog("<%=basePath%>/codeReviewActionNew!chooseDatalist.action?tablename="+tablename+"&colname="+colname+"&disname="+disname+"&cnname="+escape(encodeURIComponent(cnname))+"&fileColname="+fileColname+"&temp="+Math.round(Math.random()*10000),'',"dialogWidth=1000px;dialogHeight=400px");
		if(typeof(datas) == 'undefined'){
		}else{
			 var json1 = eval('(' + datas + ')');
	//		 document.getElementById(id).value = json1.ID;
			 var disnamearray = disname.split(',');
			 if(id == "jiancedanwei"){
			 	document.getElementById(id).value = json1[disnamearray[0]]+' ' +json1[disnamearray[1]];
			 	document.getElementById("dizhi").value = json1[disnamearray[2]];
			 }else{
			    document.getElementById(id).value = json1[disnamearray[0]];
			 }
			 
		}
	}
	function dahui(){
/*	    var datas = window.showModalDialog("<%=request.getContextPath() %>/view/zhengchekekaoxingshiyan_yijian.jsp",'',"dialogWidth=500px;dialogHeight=300px");
		    var json2 = eval('('+datas+')');
	    	if("close" == json2.state){
	    		return false;
	    	}else{
				var reg=new RegExp("<BR>","g"); 
				var remarkVal = remark.remark.replace(reg,"\n"); 
				$("#yijian").val(remarkVal);
	    	}*/
        var actionUrl = '<%=request.getContextPath()%>/weituodan!tuihuiWeituodan.action'; 
        var param = {
                      "flowname":$("#flowname").val(),
                      "flowid":"${flowid}",
                      "stateid":"${stateid}",
                      "steptypeback":$("#steptypeback0").val(),
                      "taskinfoid":"${taskinfoid}",
                      "gongyingshangId":$("#gongyingshangId").val(),
                      "weituodanid":$("#weituodanid").val()
            };
    	$.ajax({  
			        url : actionUrl,  
			        type : "post", 
			        data : param,  
			        dataType : "json",  
			        cache : false,  
			 error : function(textStatus, errorThrown) {  
			        alert("系统ajax交互错误: " + textStatus.value);  
		    },  
		    success : function(data, textStatus) {
		        if(data.ajaxResult=='success'){ 
		        //      window.returnValue = returnValue;     
				      alert("退回成功");
				      W.reload();
					  api.close();
                   }else{
                       alert("处理失败!");
                       W.reload();
                   }
		    }    
			});
    }
    //委外试验
    function weiwaishiyan(){
        if(!confirm("是否确认委外试验 ？")){
		   return false;
		}
    	var actionUrl = '<%=request.getContextPath()%>/weituodan!weiwaishiyan.action'; 
        var param = {
                      "flowname":$("#flowname").val(),
                      "flowid":"${flowid}",
                      "stateid":"${stateid}",
                      "steptype":$("#steptype1").val(),
                      "taskinfoid":"${taskinfoid}",
                      "gongyingshangId":$("#gongyingshangId").val(),
                      "weituodanid":$("#weituodanid").val(),
                      "weituodanshibieno":$("#weituodanshibieno").val(),
                      "feiyongzongji":$("#feiyongzongji").val()
            };
    	$.ajax({  
			        url : actionUrl,  
			        type : "post", 
			        data : param,  
			        dataType : "json",  
			        cache : false,  
			 error : function(textStatus, errorThrown) {  
			        alert("系统ajax交互错误: " + textStatus.value);  
		    },  
		    success : function(data, textStatus) {
		        if(data.result=='success'){ 
		        //      window.returnValue = returnValue;     
				      alert("提交成功");
				      W.reload();
					  api.close();
                   }else{
                       alert("处理失败!");
                       W.reload();
                   }
		    }    
			});
    }
    //生成样品编号
    function shengchengyangpinno(){
    	var actionUrl2 = '<%=request.getContextPath()%>/weituodan!shengchengyangpinNo.action'; 
        var param = {
                      "flowtaskid":${flowtaskid},
                      "weituodanshibieno":$("#weituodanshibieno").val()
            };
    	$.ajax({  
			        url : actionUrl2,  
			        type : "post", 
			        data : param,  
			        dataType : "json",  
			        cache : false,  
			 error : function(textStatus, errorThrown) {  
			        alert("系统ajax交互错误: " + textStatus.value);  
		    },  
		    success : function(data, textStatus) {
		        if(data.result=='success'){ 
		        //      window.returnValue = returnValue;     
				      alert("处理成功");
				      gridSearchSample(${flowtaskid});
                   }else{
                       alert("处理失败!");
                   }
		    }    
			});
    }
    //刷新样品列表
   function gridSearchSample(flowtaskid){
        jQuery("#gridTableSample1").jqGrid('setGridParam',
              {
                  url:'<%=request.getContextPath() %>/autoForms/item!querySampleByTaskId.action?taskId='+flowtaskid
              }).trigger("reloadGrid", [{page:1}]); 
   }
   //任务分配
   function renwufenpei(){
        var jiancerenid = $("#jiancerenid").val();
        var jianceren = $("#jianceren").val();
        if(jianceren ==null || jianceren == "" ){
			alert("请选择检测人！");
			$("#jianceren").focus();
    		return false;
		}
       var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
	    if (!ids) {
	    alert("请先选择记录!");  
	       return false;  
		} 
		var params = {
		            "jiancerenid":jiancerenid,
		            "jianceren":jianceren,  
			        "ids": ids
			    };  
		var actionUrl = "<%=request.getContextPath() %>/weituodan!renwufenpei.action";  
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      data : params,  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if(data.result=='success'){
		      		alert("任务分配成功！");       
		      		gridSearchSampleAndItem();    
		      	}else{
		      		alert("任务分配失败！");
		      	}
		    }  
		});
   
   }
   //刷新样品/检测项目列表
	   function gridSearchSampleAndItem(){
        jQuery("#gridTable").jqGrid('setGridParam',
              {
                  url:common_basePath+'autoForms/item!queryItemSampleByTaskId.action?taskId=${flowtaskid}&stateId=${stateid}&flowtaskinfoid=${taskinfoid}&temp='+Math.round(Math.random()*10000)
              }).trigger("reloadGrid", [{page:1}]); 
        }
   
   //添加故障
   function tianjiaG(){
 //  	  var toUrl = '<%=request.getContextPath() %>/auto!gotoAdd.action?formid=4424&fromtype=flow&byTableValue=&byTableColumn=&flowtaskid=${flowtaskid}&temp='+Math.round(Math.random()*10000);
 	  var toUrl = '<%=request.getContextPath() %>/weituodan!gotoAddGuzhang.action?shibiehao=${weituodan.WEITUODANSHIBIENO}&flowtaskid=${flowtaskid}&temp='+Math.round(Math.random()*10000);
	  W.$.dialog({
	        title: '故障添加页面',
	        content: 'url:'+ toUrl,
			okVal: false,//确定按钮文字
	        cancelVal: false,//取消按钮文字
	        min: true, //是否显示最小化按钮
	        max: false,//是否显示最大化按钮
	        fixed: false,//开启静止定位
	        lock: true,//开启锁屏
	        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）
	        time: null,//设置对话框显示时间
	        resize: true,//是否允许用户调节尺寸
	        drag: true,//是否允许用户拖动位置
	        cache: false,//是否缓存iframe方式加载的窗口内容页
	        width: 480,
	        height: 500,
	        close: function(){
	        	gridSearchGuzhang();
		    }
		});
   }
   //刷新故障列表
   function gridSearchGuzhang(){
   		jQuery("#gridTable1").jqGrid('setGridParam',
        {
            url:common_basePath+'/weituodan!queryGuzhangByTaskId.action?taskId=${flowtaskid}',
        }).trigger("reloadGrid", [{page:1}]); 
   }
   //修改故障信息
   function xiugaiG(){
   		 var ids= $("#gridTable1").jqGrid("getGridParam", "selarrrow") + "";
		if (!ids) {
		    alert("请先选择记录!");  
		    return false;  
		}
		if(ids.indexOf(",")!=-1){
			  alert("只能选择一条记录!");  
		        return false; 
		}
		var row = jQuery("#gridTable1").jqGrid('getRowData',ids);//获取选中行.
		var id = row.ID;
		var toUrl = '<%=request.getContextPath() %>/weituodan!gotoUpdateGuzhang.action?id='+id;
		W.$.dialog({
	        title: '故障修改页面',
	        content: 'url:'+ toUrl,
	        okVal: false,//确定按钮文字-->
	        cancelVal: false,//取消按钮文字-->
	        min: true, //是否显示最小化按钮-->
	        max: false,//是否显示最大化按钮-->
	        fixed: false,//开启静止定位-->
	        lock: true,//开启锁屏-->
	        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）-->
	        time: null,//设置对话框显示时间-->
	        resize: true,//是否允许用户调节尺寸-->
	        drag: true,//是否允许用户拖动位置-->
	        cache: false,//是否缓存iframe方式加载的窗口内容页
	        width: 480,
	        height: 500,
	        close: function(){
	        	gridSearchGuzhang();
		    }
		});
   }
   //删除故障
   function shanchuG(){
   		var ids= $("#gridTable1").jqGrid("getGridParam", "selarrrow") + "";
		if (!ids) {
		    alert("请先选择记录!");  
		    return false;  
		}
		if(!confirm("是否确认删除？")){
			return false;
		}
		var params = {
					"mainIds": ids,
					"tableName":"GUZHANGKU"
					};  
		var actionUrl = "<%=request.getContextPath() %>/auto!deleteForm.action";  
		$.ajax({  
			  url : actionUrl,  
		      type : "post", 
		      data : params,  
		      dataType : "json",  
		      cache : false,  
		      error : function(textStatus, errorThrown) {  
		          alert("系统ajax交互错误: " + textStatus.value);  
		      },  
		      success : function(data, textStatus) {
		      	if(data.result=='success'){
		      		alert("删除成功！");       
		      		gridSearchGuzhang();
		      	}else{
		      		alert("删除失败！");
		      	}
		    }  
		});
   }
   //选择设备
   function xuanzeshebei(flag){// flag 0增删改  1查看
   		var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
	    if (!ids) {
	   	   alert("请先选择记录!");  
	       return false;  
		}
		if(ids.indexOf(",")!=-1 && flag!="0"){//选择两条以上项目
			if(!checkIsSameSB(ids)){
				alert("所选检测项目选择的设备存在不同，请重新选择！");
			   	return false;
			}
		}
		var toUrl = '<%=request.getContextPath() %>/workflow/chooseTask_shebeilist.jsp?flag='+flag+'&taskId=${flowtaskid}&item_sample_id='+ids+'&temp='+Math.round(Math.random()*10000);
		W.$.dialog({
	        title: '选择设备',
	        content: 'url:'+ toUrl,
	        okVal: false,//确定按钮文字-->
	        cancelVal: false,//取消按钮文字-->
	        min: true, //是否显示最小化按钮-->
	        max: false,//是否显示最大化按钮-->
	        fixed: false,//开启静止定位-->
	        lock: true,//开启锁屏-->
	        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）-->
	        time: null,//设置对话框显示时间-->
	        resize: true,//是否允许用户调节尺寸-->
	        drag: true,//是否允许用户拖动位置-->
	        cache: false,//是否缓存iframe方式加载的窗口内容页
	        width: 1200,
	        height: 600
		});
   }
   //判断是否选择相同的设备
   function checkIsSameSB(itemSampleIds){
   		var flag = false;
        $.ajax({  
            url : '<%=request.getContextPath() %>/yanfajianceShebei!checkIsSameSB.action?itemSampleIds='+itemSampleIds,  
            type : "post", 
            async: false,//取消异步提交 
            dataType : "json",  
            success : function(data, textStatus) {  
	           if(data.result=="hava")
	             {
	               flag = true;
	             }
            }  
       });
       return flag;
   }
   //打开原始记录 查看和编辑共用
	function yuanshijilu(operateType){
		var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
		if (!ids) {
        	alert("请先选择记录!");  
            return false;  
        }
        if(operateType=='0'){
            //判断已选的数据的样品是否接收
            var flag1 = checkYsjlPath(ids,0);
            if(flag1=='true'){
               alert("您还未接收样品,试验无法进行!");
               return false;
            }
         }
        /**
        else if(ids.indexOf(",")!=-1){
           //判断已选的数据的原始记录单路径是否相同
           var flag  = checkYsjlPath(ids,0);
           if(flag=='true'){
             alert("请选择原始记录路径相同的数据!");
             return false;
           }
        
        }
        **/
       var stateid = '${stateid}';
       if(operateType=='1'){   //查询原始记录单页面不显示确定按钮
         stateid='true';
       }
        if(operateType=='0'){
          var returnValue = window.showModalDialog("<%=basePath%>/workflow/filemodeedit_new.jsp?ids="+ids+"&taskId=${flowtaskid}&childFlowid=${flowtaskid}&operateType="+operateType+"&flowtypeid=${flowid}&stateid="+stateid+"&userseq=${userseq}&shiyanbh=${shiyanbh}",'',"dialogWidth=1050px;dialogHeight=650px");
        }else{
		  window.open("<%=basePath%>/workflow/filemodeedit_new.jsp?ids="+ids+"&taskId=${flowtaskid}&operateType="+operateType+"&ysjlType=0");
	    }
		gridSearchSampleAndItem();
	}
   //编制报告
   function bianzhibaogao(operate_type){
   		var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
	    if (!ids) {
	    alert("请先选择记录!");  
	       return false;  
		}
		if(operate_type==0){
	          if(ids.indexOf(",")!=-1){
	           var flag  = checkYsjlPath(ids,1);
	           if(flag!='false'){
	              alert("请选择原始记录模版相同的数据!");
	              return false;
	           }
	          else {
	                var flag2 = checkYsjlPath(ids,2);
		            if(flag2=='true'){
		               alert("请选择报告路径相同的数据!");
		               return false;
		           }
	             }
	          
	          }
	       //判读原始记录是否有报告
	       /**
	        var flag3 = checkYsjlPath(ids,3);
	        if(flag3=='false'){
	         alert("已选的数据没有报告模版,请先添加报告模版!");
	         return false;
	        }
	        **/
        }else if(operate_type==1){
            var flag2 = checkYsjlPath(ids,2);
            if(flag2=='true'){
               alert("请选择报告路径相同的数据!");
               return false;
            }
           } 
        if(operate_type=='0'){
			var returnValue = window.showModalDialog("<%=basePath%>/workflow/filemodeedit_hgz.jsp?ids="+ids+"&taskId=${flowtaskid}&childFlowid=${flowtaskid}&operateType="+operate_type+"&stateid=${stateid}&mainid=${mainid}",'',"dialogWidth=1050px;dialogHeight=650px;scroll:yes");
			gridSearchSampleAndItem();
		}else{
		  window.open("<%=basePath%>/workflow/filemodeedit_hgz.jsp?ids="+ids+"&taskId=${flowtaskid}&childFlowid=${flowtaskid}&operateType="+operate_type+"&stateid=${stateid}&mainid=${mainid}");
		}
   }
   //判断原始记录单的路径是否相同
	function checkYsjlPath(ids,sign){
	  var flag ='';
	  var params = {  
             "ids": ids,
             "sign":sign
          };  
         var actionUrl = "<%=request.getContextPath() %>/codeReviewActionNew!checkYsjlPath.action";  
             $.ajax({  
                 url : actionUrl,  
                 type : "post", 
                 async: false,//取消异步提交
                 data : params,  
                 dataType : "json",  
                 cache : false,  
             error : function(textStatus, errorThrown) {  
                 alert("系统ajax交互错误: " + textStatus.value);  
             },  
             success : function(data, textStatus) {  
                 flag = data.result;
             }  
         });
	   return flag;
	}
	//下载附件
	  function downloafAnnex(flag,annexId){
	     window.location.href="<%=request.getContextPath()%>/codeReviewActionNew!downloafAnnex.action?flag="+flag+"&id="+annexId;
	  }
    //问题反馈---只添加一次，添加后再点击问题反馈按钮只查看问题反馈页面
 function WentiFankui(){
    var weituodansbh = $("#weituodanshibieno").val();
 	$.dialog({
        title: '问题反馈',
        content: 'url:<%=request.getContextPath() %>/wentifankui!gotoAdd.action?weituodansbh='+weituodansbh+'&taskid=${flowtaskid}&stateid=${stateid}',
        zIndex:2001,
        okVal: false,//确定按钮文字
        cancelVal: false,//取消按钮文字
        min: true, //是否显示最小化按钮
        max: false,//是否显示最大化按钮
        fixed: false,//开启静止定位
        lock: true,//开启锁屏
        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）
        time: null,//设置对话框显示时间
        resize: true,//是否允许用户调节尺寸
        drag: true,//是否允许用户拖动位置
        cache: false,//是否缓存iframe方式加载的窗口内容页
        width: '500px',
        height: 400
	});
 }
 //问题反馈---可多次提交问题反馈
 function WentiFankuiMore(){
    var weituodansbh = $("#weituodanshibieno").val();
 	$.dialog({
        title: '问题反馈',
        content: 'url:<%=request.getContextPath() %>/wentifankui!gotoAdd2.action?weituodansbh='+weituodansbh+'&taskid=${flowtaskid }&stateid=${stateid}',
        zIndex:2001,
        okVal: false,//确定按钮文字
        cancelVal: false,//取消按钮文字
        min: true, //是否显示最小化按钮
        max: false,//是否显示最大化按钮
        fixed: false,//开启静止定位
        lock: true,//开启锁屏
        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）
        time: null,//设置对话框显示时间
        resize: true,//是否允许用户调节尺寸
        drag: true,//是否允许用户拖动位置
        cache: false,//是否缓存iframe方式加载的窗口内容页
        width: '500px',
        height: 400
	});
 }
 //上传原始记录附件
 function ysjlFile(id){
    var show = "y";
    if("<%=request.getAttribute("stateid").toString()%>"=="proc8"){
    	show = "n";
    }
	$.dialog({
        title: '上传附件',
        content: 'url:<%=request.getContextPath() %>/weituodan!getUploadFile.action?flag=1&mainid=${weituodan.ID}&ids='+id+'&show='+show,
        zIndex:2001,
        okVal: false,//确定按钮文字
        cancelVal: false,//取消按钮文字
        min: true, //是否显示最小化按钮
        max: false,//是否显示最大化按钮
        fixed: false,//开启静止定位
        lock: true,//开启锁屏
        focus: true,//弹出窗口后是否自动获取焦点（4.2.0新增）
        time: null,//设置对话框显示时间
        resize: true,//是否允许用户调节尺寸
        drag: true,//是否允许用户拖动位置
        cache: false,//是否缓存iframe方式加载的窗口内容页
        close: function(){
        	gridSearchSampleAndItem();
        }, 
        width: '600px',
        height: 600
	});
	
 }
 //sign  0:判断已选数据的样品是否接收   1:判断原始记录单的路径是否相同 2：判断原始记录是否正在编辑 3:判断列表中的数据是否全部填写原始记录
	function checkYsjlPath(ids,sign){
	  var flag ='';
	  var params = {  
             "ids": ids,
             "sign":sign
          };  
         var actionUrl = "<%=request.getContextPath() %>/codeReviewActionNew!checkYsjlPath.action";  
             $.ajax({  
                 url : actionUrl,  
                 type : "post", 
                 async: false,//取消异步提交
                 data : params,  
                 dataType : "json",  
                 cache : false,  
             error : function(textStatus, errorThrown) {  
                 alert("系统ajax交互错误: " + textStatus.value);  
             },  
             success : function(data, textStatus) {
                 if(sign==2&&data.result=='true'){
                   flag = data.values;
                 }else{  
                   flag = data.result;
                 }
             }  
         });
	   return flag;
	}
	//报告与原始记录发放
	  function bgAndysjlfafang(){
	    var returnvalue ='true';
	    var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
		if (!ids) {
        	alert("请先选择记录!");  
            return false;  
        }
        //发放最后一份原始记录或检测报告时如样品未退回，则提示调度员“检测样品未退回”
 //       if(checkAllbgysjl(1,ids)){
           returnvalue = window.showModalDialog("<%=request.getContextPath()%>/workflow/changguijiance_remind.jsp",'',"dialogWidth=400px;dialogHeight=250px");
 //       }
        if(returnvalue=='true'){
             var actionUrl = "<%=request.getContextPath() %>/codeReviewActionNew!bgAndysjlfafang.action?ids="+ids+"&temp="+Math.round(Math.random()*10000);  
	         $.ajax({   
	            url : actionUrl,   
	            type : "post",  
	       	    dataType : "json",  
	        	cache : false,   
	        	async:false,
	    		error : function(textStatus, errorThrown) {   
	      	 		alert("系统ajax交互错误: " + textStatus.value);   
	   		     },   
	   		   success : function(data, textStatus) {   
	         		  if(data.ajaxResult=='success'){
	         		    alert("报告与原始记录发放成功！");  
	         		    gridSearchSampleItem();  
	         		  }
	         		  else if(data.ajaxResult=='error'){
	         		    alert("报告与原始记录发放失败,请重试!");  
	         		  }
	    		}   
	     	}); 
        }
        
	  }
	   //删除原始记录
	  function deleteYsjl(){
		var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
         if (!ids) {
         alert("请先选择记录!");  
            return false;  
         } 
        
         if(!confirm("是否确认删除？")){
            return false;
         }
          var params = {  
             "ids": ids
          }; 
         var actionUrl = "<%=request.getContextPath() %>/item!delYsjl.action";  
             $.ajax({  
                 url : actionUrl,  
                 type : "post", 
                 data : params,  
                 dataType : "json",  
                 cache : false,  
             error : function(textStatus, errorThrown) {  
                 alert("系统ajax交互错误: " + textStatus.value);  
             },  
             success : function(data, textStatus) {  
                if(data.ajaxResult=='success'){
                  alert("原始记录删除成功!");
                  gridSearchSampleAndItem();
                }
                else{
                  alert("原始记录删除失败,请重试!");
                  return false;
                }   
                 
             }  
         });
	}
	//填写原始记录节点  删除检测参数
	 function deleteJiancecanshu(){
		 var ids = $("#gridTable").jqGrid("getGridParam", "selarrrow") + "";
         if (!ids) {
            alert("请先选择记录!");  
            return false;  
         } 
         if(!confirm("是否确认删除？")){
            return false;
         }
          var params = {  
             "ids": ids,
             "flag":0
          }; 
         var actionUrl = "<%=request.getContextPath() %>/item!updateJiancecanshu.action";  
             $.ajax({  
                 url : actionUrl,  
                 type : "post", 
                 data : params,  
                 dataType : "json",  
                 cache : false,  
             error : function(textStatus, errorThrown) {  
                 alert("系统ajax交互错误: " + textStatus.value);  
             },  
             success : function(data, textStatus) {  
                if(data.ajaxResult=='success'){
                  alert("检测参数删除成功!");
                  gridSearchSampleAndItem();
                }
                else{
                  alert("检测参数删除失败,请重试!");
                  return false;
                }   
                 
             }  
         });
	 }
	 
	 //恢复检测参数
	 function huifujiancecanshu(){
	     var url = "<%=request.getContextPath()%>/workflow/huifujiancebiaozhun.jsp?taskInfoId=${taskinfoid}&temp="+Math.round(Math.random()*10000);
	     var  array = window.showModalDialog(url,null,"dialogHeight:600px;dialogWidth:900px;scroll:no");
	     gridSearchSampleAndItem();     
	 }
   </script>
 	<style type="text/css">
 		body{
 			background:#ffffff; background-image:url(images/);
 		}
   		html{
		    overflow-x: hidden;
			overflow-y: hidden;
		}  	
		.formTableNew textarea{border: 1px solid #999;padding: 5px;width: 760px;-moz-border-radius: 3px;border-radius: 3px;margin-bottom: 5px;color: #666;background: url(../images/input_bg.gif) repeat-x top;}
   </style>
  </head>
  
  <body style="overflow-y: scroll;">
<form id="pageFrom" action="" enctype="multipart/form-data" method="post">
        <input type="hidden" name="flowid" id="flowid" value="${flowid}">
     	<input type="hidden" name="stateid" id="stateid" value="${stateid}">
     	<input type="hidden" name="taskinfoid" id="taskinfoid" value="${taskinfoid}">
  		<input type="hidden" id="spyj" name="spyj" value="" />
  		<input type="hidden" id="backoption" name="backoption" value="" />
  		<input type="hidden" id="gridids" name="gridids" value="" />
  		<input type="hidden" id="weituodanid" name="weituodanid" value="${weituodan.ID}" />
  		<input type="hidden" id="flowtaskid" name="flowtaskid" value="${flowtaskid}" />
     	<input type="hidden" id="baogaoshenheren" name="baogaoshenheren" value="" />
     	<input type="hidden" id="baogaopizhunren" name="baogaopizhunren" value="" />
     	<input type="hidden" id="dagangshenheren" name="dagangshenheren" value="" />
     	<input type="hidden" id="huiqianren" name="huiqianren" value="" />
     	<input type="hidden" id="dagangpizhunren" name="dagangpizhunren" value="" />
     	<input type="hidden" id="T_YSJLSHR" name="T_YSJLSHR" value=""/>
  		<table width="100%" border="0" align="center" cellpadding="5" cellspacing="5" class="formTableNew">
  			<tr>
  			  <tr>
  		    	<td align="right">流程名称：</td>
  		    	<td colspan="3" align="left">
	  			    <input  type="text" readonly id="flowname" maxlength="50" name="flowname" style="border: 1px solid #999;padding: 5px;width: 738px;"  value="${flowname }" />
  			    </td>
  		    </tr>
  			<tr>
  			  <td align="right">任务名称：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="renwuname" maxlength="50" name="renwuname" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.RENWUNAME}" />
  			  	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">检测单位：</td>
  			   <td align="left">
  			    <input  type="text" readonly id="jiancedanwei" name="jiancedanwei" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.JIANCEDANWEI}" />
  			   	<img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			   </td>
  			</tr>
  			<tr>
  			  <td align="right">检测地点：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="jiancedidian" name="jiancedidian" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.JIANCEDIDIAN}" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">申请单位：</td>
  			   <td align="left">
  			    <input  type="text" readonly id="shenqingdanwei" maxlength="50" name="shenqingdanwei" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.SHENQINGDANWEI}" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			   </td>
  			</tr>
  			<tr>
  			  <td align="right">联系人：</td>
  			  <td align="left">
  			  	 <input  type="text"  id="lianxiren" readonly name="lianxiren" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.LIANXIREN}" />
  			     <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">申请日期：</td>
  			  <td align="left">
  			    <input  type="text"  id="shenqingdate" readonly maxlength="50"  name="shenqingdate" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.SHENQINGDATE}" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">联系电话：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="lianxidianhua" maxlength="50"  name="lianxidianhua" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.LIANXIDIANHUA}" />
  			  </td>
  			  <td align="right">地址：</td>
  			  <td align="left">
  			     <input  type="text" readonly id="dizhi" maxlength="50" name="dizhi" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.DIZHI}" />
  			     <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">邮编：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="youbian" maxlength="50"  name="youbian" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.YOUBIAN}" />
  			  </td>
  			  <td align="right">检测目的：</td>
  			  <td align="left">
  			     <input  type="text" readonly id="jiancemudi" maxlength="50" name="jiancemudi" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.JIANCEMUDI}" />
  			     <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			</tr>
  			<tr>
  			  <td align="right">双方约定日期：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="shuangfangyuedingdate" maxlength="50"  name="shuangfangyuedingdate" onClick="WdatePicker()" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.SHUANGFANGYUEDINGDATE}" />
  			    <img src="<%=request.getContextPath() %>/images/xh.png" align="absmiddle"></img>
  			  </td>
  			  <td align="right">费用总计：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="feiyongzongji" maxlength="50" name="feiyongzongji" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.FEIYONGZONGJI}" />
  			  </td>
  			  <td align="right">&nbsp;</td>
  			  <td align="left">&nbsp;</td>
  			</tr>
  			<tr>
  				<td align="right">委托单识别号：</td>
  			  <td align="left">
  			    <input  type="text" readonly id="weituodanshibieno" maxlength="50" name="weituodanshibieno" style="border: 1px solid #999;padding: 5px;width: 250px;"  value="${weituodan.WEITUODANSHIBIENO}" />
  			  </td>
  			  <td align="right">&nbsp;</td>
  			  <td align="left">&nbsp;</td>
  			</tr>
 			<tr>
		    <td align="right"  >项目特殊说明：</td>
		    <td >
		    	<div class="div">
					<textarea rows="5" cols="100" id="xiangmuteshushuoming" name="xiangmuteshushuoming" onkeydown="countlen1(this);" style="width: 250px;">${weituodan.XIANGMUTESHUSHUOMING}</textarea>
				</div>	
		    </td>
		    <td align="right"  >样品特殊说明：</td>
		    <td >
		    	<div class="div">
					<textarea rows="5" cols="100" id="yangpinteshushuoming" name="yangpinteshushuoming" onkeydown="countlen1(this);" style="width: 250px;">${weituodan.YANGPINTESHUSHUOMING}</textarea>
				</div>	
		    </td>
		  </tr>
		  <tr>
		  	  <td align="right">项目附件：</td>
  			  <td align="left">
  			    <jsp:include page="../fileupload/attachment.jsp?id=${weituodan.ID }&column=xiangmu&show=y" ></jsp:include>
  			  </td>
  			  <td align="right">样品附件：</td>
  			  <td align="left">
  			    <jsp:include page="../fileupload/attachment.jsp?id=${weituodan.ID }&column=yangpin&show=y" ></jsp:include>
  			  </td>
		  </tr>
		  <%if("proc3".equals(request.getAttribute("stateid").toString())){ %>
		  <tr>
		  	<td align="right">试验大纲：</td>
		  	<td align="left">
  			  	<jsp:include page="../fileupload/attachment.jsp?id=${weituodan.ID }&column=shiyandagang&show=n" ></jsp:include>
  			</td>
		  </tr>
		  <%}else if("proc2".equals(request.getAttribute("stateid").toString())){%>
		  
		  <%}else{ %>
		  <tr>
		  	<td align="right">试验大纲：</td>
		  	<td align="left">
  			  	<jsp:include page="../fileupload/attachment.jsp?id=${weituodan.ID }&column=shiyandagang&show=y" ></jsp:include>
  			</td>
		  </tr>
		  <%} %>
		  <!--tr>
		  	<td align="right">审批意见：</td>
		  	<td colspan='3'><textarea id=\"shenpiyijian\" name=\"shenpiyijian\"    class='ftextarea' readonly=\"readonly\" rospan=\"8\" colspan=\"80\" style='border: 1px solid #999;padding: 5px;width:740px;height:60px'>${spyj}</textarea></td>
		  </tr-->
		  <tr>
		    <td colspan='4' align='center'>
		      <div class='easyui-tabs' id='tt1' style='width:750px;height：450px'>
		        <div title='任务信息' style='padding:10px;'>
		        <%if("proc8".equals(request.getAttribute("stateid").toString())){ %>
		        	<input id='saveBtn1' type='button'  value='原始记录' onclick="yuanshijilu('0')" class="form_bt_orange"/>
		        	<input type='button' value='删除原始记录' onclick="deleteYsjl()" class='form_bt_orange' style='width:120px;'/>
					<input type='button' value='删除检测参数' onclick="deleteJiancecanshu()" class='form_bt_orange' style='width:120px;'/>
					<input type='button' value='恢复检测参数' onclick="huifujiancecanshu()" class='form_bt_orange' style='width:120px;'/>
		        	<input id='saveBtn2' type='button'  value='选择设备' onclick="xuanzeshebei('0')" class="form_bt_orange"/>
		        	<!--input id='saveBtn3' type='button'  value='上传附件' onclick="ysjlFile()" class="form_bt_orange"/-->
		        <%}else if("proc13".equals(request.getAttribute("stateid").toString()) || "proc14".equals(request.getAttribute("stateid").toString())
						 || "proc15".equals(request.getAttribute("stateid").toString()) || "proc16".equals(request.getAttribute("stateid").toString())
						 || "gcsh".equals(request.getAttribute("stateid").toString()) || "proc9".equals(request.getAttribute("stateid").toString())){%>
					<input id='saveBtn1' type='button'  value='查看原始记录' onclick="yuanshijilu('1')" class="form_bt_orange" style='width:120px;'/>
		        <%}%>
		        <%if("proc13".equals(request.getAttribute("stateid").toString())){ %>
		          <input id='saveBtn1' type='button'  value='编制报告' onclick="bianzhibaogao('0')" class="form_bt_orange"/>
		        <%}else if("proc14".equals(request.getAttribute("stateid").toString())
						 || "proc15".equals(request.getAttribute("stateid").toString()) || "proc16".equals(request.getAttribute("stateid").toString())){%>
					<input id='saveBtn1' type='button'  value='查看报告' onclick="bianzhibaogao('1')" class="form_bt_orange"/>
		        <%}else if("gcsh".equals(request.getAttribute("stateid").toString())){%>
		        	<input id='saveBtn1' type='button'  value='查看原始记录' onclick="yuanshijilu('1')" class="form_bt_orange" style='width:120px;'/>
		        	<input id='saveBtn1' type='button'  value='查看报告' onclick="bianzhibaogao('1')" class="form_bt_orange"/>
		        	<input id='saveBtn1' type='button'  value='发放' onclick="bgAndysjlfafang()" class="form_bt_orange"/>
		        <%} %>
		       
                  <table id="gridTable"></table>
	              <div id="gridPager" ></div>
				 </div>
				 <%if("proc8".equals(request.getAttribute("stateid").toString()) || "proc13".equals(request.getAttribute("stateid").toString()) || "proc14".equals(request.getAttribute("stateid").toString())
						 || "proc15".equals(request.getAttribute("stateid").toString()) || "proc16".equals(request.getAttribute("stateid").toString())
						 || "gcsh".equals(request.getAttribute("stateid").toString())){ %>
				 <div title='故障信息' style='padding:10px'>
				      <%if("proc8".equals(request.getAttribute("stateid").toString())){ %>
			          <input id='saveBtn1' type='button'  value='添加' onclick="tianjiaG()" class="form_bt_orange"/>
			          <input id='updateBtn1' type='button'  value='修改' onclick="xiugaiG()" class="form_bt_orange"/>
			          <input id='deleteBtn1' type='button'  value='删除' onclick="shanchuG()" class="form_bt_orange"/>
			          <%} %>
	                  <table id="gridTable1" style="width:100%;"></table>
		              <div id="gridPager1"   style="width:100%;"></div>
				 </div>
				 <%} %>
				 </div>
			</td></tr>
			<%if("proc8".equals(request.getAttribute("stateid").toString())){%>
				<input type='hidden' name='steptype' id='steptype0' value='step11'/>
			<%}else{ %>
				<tr>
				<%if("proc3".equals(request.getAttribute("stateid").toString()) || "proc7".equals(request.getAttribute("stateid").toString()) || "proc13".equals(request.getAttribute("stateid").toString()) || "proc14".equals(request.getAttribute("stateid").toString())){ %>
				<%}else{ %>
					<td align="right">下一步骤：</td>
				<%} %>
			    <td colspan="3">${steptcontent}</td>
			    </tr>
			<%} %>
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
		  <tr>
			<td align="center">
			    <input id="saveBtn2" onclick="WentiFankuiMore()" type="button" value="问题反馈" class="form_bt_orange" style="width:120px"/>
			    <%if("proc2".equals(request.getAttribute("stateid").toString())){//接受任务节点 %>
			      <input id="submitBtn" type="button" value="提交" class="form_bt_orange" />
				<%}else if("proc3".equals(request.getAttribute("stateid").toString())){//编制试验大纲节点 %>
				  <input id="submitBtn" type="button" value="提 交" class="form_bt_orange" />
				<%}else{ %>
				<input id="submitBtn" type="button" value="提 交" class="form_bt_orange" />
				<%} %>
				<%if("proc3".equals(request.getAttribute("stateid").toString()) || "proc5".equals(request.getAttribute("stateid").toString())){ %>
				<%}else{ %>
		    	<!--input type="button" id="backBtn" onclick="dahui()" value="退 回" class="form_bt_orange" /-->
		    	<%} %>
		    	<input type="button" id="closeBtn" value="取 消" class="form_bt_grey" />
		    </td>
		  </tr>
		  <tr>
		  	<td>&nbsp;&nbsp; </td>
		  </tr>
		</table>
	<!--表单结束-->
	</form>
  </body>
</html>
